home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Cafe 3
/
Visual Cafe 3.ISO
/
Vcafe
/
JFC.bin
/
MotifLookAndFeel.java
< prev
next >
Wrap
Text File
|
1998-06-30
|
35KB
|
758 lines
/*
* @(#)MotifLookAndFeel.java 1.84 98/04/14
*
* Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*
* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
* SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
* THIS SOFTWARE OR ITS DERIVATIVES.
*
*/
package com.sun.java.swing.plaf.motif;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.KeyEvent;
import java.awt.event.InputEvent;
import com.sun.java.swing.*;
import com.sun.java.swing.plaf.*;
import com.sun.java.swing.border.*;
import com.sun.java.swing.text.JTextComponent;
import com.sun.java.swing.text.DefaultEditorKit;
import com.sun.java.swing.plaf.basic.BasicLookAndFeel;
import com.sun.java.swing.plaf.basic.BasicMarginBorder;
import com.sun.java.swing.plaf.basic.BasicComboBoxRenderer;
import com.sun.java.swing.plaf.basic.BasicComboBoxEditor;
/**
* Implements the Motif Look and Feel.
* UI classes not implemented specifically for Motif will
* default to those implemented in Basic.
* <p>
* For the keyboard keys defined for each component in this Look and
* Feel (L&F), see
* <a href="../../doc-files/Key-Motif.html">Component Keystroke Actions for the Motif L&F</a>.
* <p>
* Warning: serialized objects of this class will not be compatible with
* future swing releases. The current serialization support is appropriate
* for short term storage or RMI between Swing1.0 applications. It will
* not be possible to load serialized Swing1.0 objects with future releases
* of Swing. The JDK1.2 release of Swing will be the compatibility
* baseline for the serialized form of Swing objects.
*
* @version 1.84 04/14/98
* @author unknown
*/
public class MotifLookAndFeel extends BasicLookAndFeel
{
public String getName() {
return "CDE/Motif";
}
public String getID() {
return "Motif";
}
public String getDescription() {
return "The CDE/Motif Look and Feel";
}
public boolean isNativeLookAndFeel() {
String osName = System.getProperty("os.name");
return (osName != null) && (osName.indexOf("Solaris") != -1);
}
public boolean isSupportedLookAndFeel() {
return true;
}
/**
* Load the SystemColors into the defaults table. The keys
* for SystemColor defaults are the same as the names of
* the public fields in SystemColor. If the table is being
* created on a native Motif platform we use the SystemColor
* values, otherwise we create color objects whose values match
* the default CDE/Motif colors.
*/
protected void initSystemColorDefaults(UIDefaults table)
{
String[] systemColors = {
"desktop", "#005C5C", /* Color of the desktop background */
"activeCaption", "#000080", /* Color for captions (title bars) when they are active. */
"activeCaptionText", "#FFFFFF", /* Text color for text in captions (title bars). */
"activeCaptionBorder", "#B24D7A", /* Border color for caption (title bar) window borders. */
"inactiveCaption", "#AEB2C3", /* Color for captions (title bars) when not active. */
"inactiveCaptionText", "#000000", /* Text color for text in inactive captions (title bars). */
"inactiveCaptionBorder", "#AEB2C3", /* Border color for inactive caption (title bar) window borders. */
"window", "#AEB2C3", /* Default color for the interior of windows */
"windowBorder", "#AEB2C3", /* ??? */
"windowText", "#000000", /* ??? */
"menu", "#AEB2C3", /* ??? */
"menuText", "#000000", /* ??? */
"text", "#FFF7E9", /* Text background color */
"textText", "#000000", /* Text foreground color */
"textHighlight", "#000000", /* Text background color when selected */
"textHighlightText", "#FFF7E9", /* Text color when selected */
"textInactiveText", "#808080", /* Text color when disabled */
"control", "#AEB2C3", /* Default color for controls (buttons, sliders, etc) */
"controlText", "#000000", /* Default color for text in controls */
"controlHighlight", "#DCDEE5", /* Highlight color for controls */
"controlLtHighlight", "#DCDEE5", /* Light highlight color for controls */
"controlShadow", "#63656F", /* Shadow color for controls */
"controlLightShadow", "#9397A5", /* Shadow color for controls */
"controlDkShadow", "#000000", /* Dark shadow color for controls */
"scrollbar", "#AEB2C3", /* Scrollbar ??? color. PENDING(jeff) foreground? background? ?*/
"info", "#FFF7E9", /* ??? */
"infoText", "#000000" /* ??? */
};
loadSystemColors(table, systemColors);
}
protected void initClassDefaults(UIDefaults table)
{
super.initClassDefaults(table);
String motifPackageName = "com.sun.java.swing.plaf.motif.";
Object[] uiDefaults = {
"ButtonUI", motifPackageName + "MotifButtonUI",
"CheckBoxUI", motifPackageName + "MotifCheckBoxUI",
"DirectoryPaneUI", motifPackageName + "MotifDirectoryPaneUI",
"FileChooserUI", motifPackageName + "MotifFileChooserUI",
"LabelUI", motifPackageName + "MotifLabelUI",
"MenuBarUI", motifPackageName + "MotifMenuBarUI",
"MenuUI", motifPackageName + "MotifMenuUI",
"MenuItemUI", motifPackageName + "MotifMenuItemUI",
"CheckBoxMenuItemUI", motifPackageName + "MotifCheckBoxMenuItemUI",
"RadioButtonMenuItemUI", motifPackageName + "MotifRadioButtonMenuItemUI",
"RadioButtonUI", motifPackageName + "MotifRadioButtonUI",
"ToggleButtonUI", motifPackageName + "MotifToggleButtonUI",
"PopupMenuUI", motifPackageName + "MotifPopupMenuUI",
"ProgressBarUI", motifPackageName + "MotifProgressBarUI",
"ScrollBarUI", motifPackageName + "MotifScrollBarUI",
"ScrollPaneUI", motifPackageName + "MotifScrollPaneUI",
"SliderUI", motifPackageName + "MotifSliderUI",
"SplitPaneUI", motifPackageName + "MotifSplitPaneUI",
"TabbedPaneUI", motifPackageName + "MotifTabbedPaneUI",
"TextAreaUI", motifPackageName + "MotifTextAreaUI",
"TextFieldUI", motifPackageName + "MotifTextFieldUI",
"PasswordFieldUI", motifPackageName + "MotifPasswordFieldUI",
"TextPaneUI", motifPackageName + "MotifTextPaneUI",
"EditorPaneUI", motifPackageName + "MotifEditorPaneUI",
"TreeUI", motifPackageName + "MotifTreeUI",
"InternalFrameUI", motifPackageName + "MotifInternalFrameUI",
"DesktopPaneUI", motifPackageName + "MotifDesktopPaneUI",
"SeparatorUI", motifPackageName + "MotifSeparatorUI",
"OptionPaneUI", motifPackageName + "MotifOptionPaneUI",
"ComboBoxUI", motifPackageName + "MotifComboBoxUI",
"DesktopIconUI", motifPackageName + "MotifDesktopIconUI",
};
table.putDefaults(uiDefaults);
}
protected void initComponentDefaults(UIDefaults table)
{
super.initComponentDefaults(table);
FontUIResource dialogPlain12 = new FontUIResource("Dialog",
Font.PLAIN, 12);
FontUIResource serifPlain12 = new FontUIResource("Serif",
Font.PLAIN, 12);
FontUIResource sansSerifPlain12 = new FontUIResource("SansSerif",
Font.PLAIN, 12);
FontUIResource monospacedPlain12 = new FontUIResource("Monospaced",
Font.PLAIN, 12);
ColorUIResource red = new ColorUIResource(Color.red);
ColorUIResource black = new ColorUIResource(Color.black);
ColorUIResource white = new ColorUIResource(Color.white);
ColorUIResource lightGray = new ColorUIResource(Color.lightGray);
ColorUIResource controlDarker = new ColorUIResource(147, 151, 165); // slate blue
ColorUIResource scrollBarTrack = controlDarker;
ColorUIResource menuItemPressedBackground = new ColorUIResource(165,165,165);
ColorUIResource menuItemPressedForeground = new ColorUIResource(0,0,0);
Object loweredBevelBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifBorderFactory.getLoweredBevelBorder();
}
};
Object focusBevelBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return new BorderUIResource( new CompoundBorder(
MotifBorderFactory.getFocusBorder(),
MotifBorderFactory.getLoweredBevelBorder()) );
}
};
Object raisedBevelBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifBorderFactory.getRaisedBevelBorder();
}
};
Object buttonBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return new BorderUIResource( new CompoundBorder(
MotifBorderFactory.getButtonBorder(),
BasicMarginBorder.getMarginBorder()) );
}
};
Object buttonToggleBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return new BorderUIResource( new CompoundBorder(
MotifBorderFactory.getToggleButtonBorder(),
BasicMarginBorder.getMarginBorder()) );
}
};
Object fieldTextBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifBorderFactory.getFieldBorder();
}
};
Object progressBarBorder = new BorderUIResource(
MotifBorderFactory.getLoweredBevelBorder());
Object multilineTextBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return BasicMarginBorder.getMarginBorder();
}
};
Object menuItemCheckIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifIconFactory.getMenuItemCheckIcon();
}
};
Object menuItemArrowIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifIconFactory.getMenuItemArrowIcon();
}
};
Object menuArrowIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifIconFactory.getMenuArrowIcon();
}
};
Object checkBoxIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifIconFactory.getCheckBoxIcon();
}
};
Object radioButtonIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifIconFactory.getRadioButtonIcon();
}
};
Object unselectedTabBackground = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
Color c = (Color)table.get("control");
return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0));
}
};
Object unselectedTabForeground = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
Color c = (Color)table.get("controlText");
return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0));
}
};
Object unselectedTabShadow = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
Color c = (Color)table.get("control");
Color base = new Color(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0));
return new ColorUIResource(base.darker());
}
};
Object unselectedTabHighlight = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
Color c = (Color)table.get("control");
Color base = new Color(Math.max((int)(c.getRed()*.85),0),
Math.max((int)(c.getGreen()*.85),0),
Math.max((int)(c.getBlue()*.85),0));
return new ColorUIResource(base.brighter());
}
};
// *** Text
JTextComponent.KeyBinding[] fieldBindings = {
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT,
InputEvent.CTRL_MASK),
DefaultEditorKit.copyAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT,
InputEvent.SHIFT_MASK),
DefaultEditorKit.pasteAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,
InputEvent.SHIFT_MASK),
DefaultEditorKit.cutAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_F,
InputEvent.CTRL_MASK),
DefaultEditorKit.forwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_B,
InputEvent.CTRL_MASK),
DefaultEditorKit.backwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_D,
InputEvent.CTRL_MASK),
DefaultEditorKit.deleteNextCharAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionBackwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionForwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
InputEvent.CTRL_MASK),
DefaultEditorKit.previousWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
InputEvent.CTRL_MASK),
DefaultEditorKit.nextWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
InputEvent.CTRL_MASK |
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionPreviousWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
InputEvent.CTRL_MASK |
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionNextWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH,
InputEvent.CTRL_MASK),
DefaultEditorKit.selectAllAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
DefaultEditorKit.beginLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
DefaultEditorKit.endLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionBeginLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionEndLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
JTextField.notifyAction)
};
JTextComponent.KeyBinding[] multilineBindings = {
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT,
InputEvent.CTRL_MASK),
DefaultEditorKit.copyAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT,
InputEvent.SHIFT_MASK),
DefaultEditorKit.pasteAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,
InputEvent.SHIFT_MASK),
DefaultEditorKit.cutAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_F,
InputEvent.CTRL_MASK),
DefaultEditorKit.forwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_B,
InputEvent.CTRL_MASK),
DefaultEditorKit.backwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_D,
InputEvent.CTRL_MASK),
DefaultEditorKit.deleteNextCharAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_N,
InputEvent.CTRL_MASK),
DefaultEditorKit.downAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_P,
InputEvent.CTRL_MASK),
DefaultEditorKit.upAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionBackwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionForwardAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
InputEvent.CTRL_MASK),
DefaultEditorKit.previousWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
InputEvent.CTRL_MASK),
DefaultEditorKit.nextWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
InputEvent.CTRL_MASK |
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionPreviousWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
InputEvent.CTRL_MASK |
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionNextWordAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH,
InputEvent.CTRL_MASK),
DefaultEditorKit.selectAllAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
DefaultEditorKit.beginLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
DefaultEditorKit.endLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_HOME,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionBeginLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_END,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionEndLineAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0),
DefaultEditorKit.upAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
DefaultEditorKit.downAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),
DefaultEditorKit.pageUpAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),
DefaultEditorKit.pageDownAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_UP,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionUpAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN,
InputEvent.SHIFT_MASK),
DefaultEditorKit.selectionDownAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
DefaultEditorKit.insertBreakAction),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0),
DefaultEditorKit.insertTabAction)
};
// *** Tree
Object treeOpenIcon = LookAndFeel.makeIcon(getClass(),
"icons/TreeOpen.gif");
Object treeClosedIcon = LookAndFeel.makeIcon(getClass(),
"icons/TreeClosed.gif");
Object treeLeafIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifTreeCellRenderer.loadLeafIcon();
}
};
Object treeExpandedIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifTreeUI.MotifExpandedIcon.createExpandedIcon();
}
};
Object treeCollapsedIcon = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return MotifTreeUI.MotifCollapsedIcon.createCollapsedIcon();
}
};
Object comboBoxRendererActiveValue = new UIDefaults.ActiveValue() {
public Object createValue(UIDefaults table) {
return new MotifComboBoxRenderer.UIResource();
}
};
Object comboBoxEditorActiveValue = new UIDefaults.ActiveValue() {
public Object createValue(UIDefaults table) {
return new BasicComboBoxEditor.UIResource();
}
};
Object menuBarBorder = new UIDefaults.LazyValue(){
public Object createValue(UIDefaults table) {
return MotifBorderFactory.getMenuBarBorder();
// implements UIResource
}
};
Object menuMarginBorder = new UIDefaults.LazyValue() {
public Object createValue(UIDefaults table) {
return new BorderUIResource(new CompoundBorder(
MotifBorderFactory.getLoweredBevelBorder(),
BasicMarginBorder.getMarginBorder()) );
}
};
Object popupMenuBorder = new UIDefaults.LazyValue(){
public Object createValue(UIDefaults table) {
return new BorderUIResource(MotifBorderFactory.getRaisedBevelBorder());
}
};
Object focusCellHighlightBorder = new BorderUIResource(
new LineBorder((Color)table.get("activeCaptionBorder")) );
Object[] defaults = {
"Desktop.background", table.get("desktop"),
"Panel.background", table.get("control"),
"Panel.foreground", table.get("textText"),
"Panel.font", dialogPlain12,
"ProgressBar.foreground", controlDarker,
"ProgressBar.border", progressBarBorder,
"ProgressBar.cellLength", new Integer(9),
"ProgressBar.cellSpacing", new Integer(0),
"Button.border", buttonBorder,
"Button.background", table.get("control"),
"Button.foreground", table.get("controlText"),
"Button.focus", table.get("controlText"),
"Button.pressed", table.get("controlLightShadow"),
"Button.font", dialogPlain12,
"Button.shadow", controlDarker,
"RadioButton.background", table.get("control"),
"RadioButton.foreground", table.get("controlText"),
"RadioButton.font", dialogPlain12,
"RadioButton.icon", radioButtonIcon,
"RadioButton.focus", table.get("activeCaptionBorder"),
"RadioButton.icon", radioButtonIcon,
"CheckBox.icon", checkBoxIcon,
"CheckBox.focus", table.get("activeCaptionBorder"),
"RadioButtonMenuItem.icon", radioButtonIcon,
"CheckBoxMenuItem.icon", checkBoxIcon,
"ToggleButton.border", buttonToggleBorder,
"ToggleButton.background", table.get("control"),
"ToggleButton.foreground", table.get("controlText"),
"ToggleButton.focus", table.get("controlText"),
"ToggleButton.selected", table.get("controlLightShadow"),
"ToggleButton.pressed", table.get("controlLightShadow"),
"ToggleButton.font", dialogPlain12,
"Menu.border", menuMarginBorder,
"Menu.font", dialogPlain12,
"Menu.foreground", table.get("menuText"),
"Menu.background", table.get("menu"),
"Menu.pressedForeground", menuItemPressedForeground,
"Menu.pressedBackground", menuItemPressedBackground,
"Menu.arrowIcon", menuArrowIcon,
"MenuBar.border", menuBarBorder,
"MenuBar.background", table.get("menu"),
"MenuBar.foreground", table.get("menuText"),
"MenuBar.font", dialogPlain12,
"MenuItem.border", menuMarginBorder,
"MenuItem.font", dialogPlain12,
"MenuItem.acceleratorFont", dialogPlain12,
"MenuItem.foreground", table.get("menuText"),
"MenuItem.background", table.get("menu"),
"MenuItem.pressedForeground", menuItemPressedForeground,
"MenuItem.pressedBackground", menuItemPressedBackground,
"MenuItem.checkIcon", menuItemCheckIcon,
"MenuItem.arrowIcon", menuItemArrowIcon,
"PopupMenu.background", table.get("menu"),
"PopupMenu.border", popupMenuBorder,
"PopupMenu.foreground", table.get("menuText"),
"PopupMenu.font", dialogPlain12,
"Label.font", dialogPlain12,
"Label.background", table.get("control"),
"Label.foreground", table.get("controlText"),
"List.focusCellHighlightBorder", focusCellHighlightBorder,
"DesktopIcon.icon", LookAndFeel.makeIcon(getClass(),
"icons/DesktopIcon.gif"),
"ScrollBar.background", scrollBarTrack,
"ScrollBar.foreground", table.get("control"),
"ScrollBar.track", scrollBarTrack,
"ScrollBar.trackHighlight", table.get("controlDkShadow"),
"ScrollBar.thumb", table.get("control"),
"ScrollBar.thumbHighlight", table.get("controlHighlight"),
"ScrollBar.thumbDarkShadow", table.get("controlDkShadow"),
"ScrollBar.thumbLightShadow", table.get("controlShadow"),
"ScrollBar.border", loweredBevelBorder,
"ScrollPane.border", null,
"ScrollPane.font", dialogPlain12,
"ScrollPane.background", table.get("control"),
"ScrollPane.foreground", table.get("controlText"),
"ScrollPane.viewportBorder", loweredBevelBorder,
"Slider.border", focusBevelBorder,
"Slider.foreground", table.get("control"),
"Slider.background", controlDarker,
"Slider.highlight", table.get("controlHighlight"),
"Slider.shadow", table.get("controlShadow"),
"Slider.focus", table.get("controlDkShadow"),
"SplitPane.background", table.get("control"),
"SplitPane.highlight", table.get("controlHighlight"),
"SplitPane.shadow", table.get("controlShadow"),
"SplitPane.dividerSize", new Integer(18),
"TabbedPane.font", dialogPlain12,
"TabbedPane.tabBackground", table.get("control"),
"TabbedPane.tabForeground", table.get("controlText"),
"TabbedPane.tabHighlight", table.get("controlHighlight"),
"TabbedPane.tabShadow", table.get("controlShadow"),
"TabbedPane.unselectedTabBackground", unselectedTabBackground,
"TabbedPane.unselectedTabForeground", unselectedTabForeground,
"TabbedPane.unselectedTabHighlight", unselectedTabHighlight,
"TabbedPane.unselectedTabShadow", unselectedTabShadow,
"TabbedPane.focus", table.get("activeCaptionBorder"),
"Tree.background", controlDarker, // default: dark slate blue
"Tree.hash", table.get("controlDkShadow"), // default: black
"Tree.iconShadow", table.get("controlShadow"),
"Tree.iconHighlight", table.get("controlHighlight"),
"Tree.iconBackground", table.get("control"),
"Tree.iconForeground", table.get("controlShadow"), // default: black
"Tree.borderSelectionColor", table.get("activeCaptionBorder"), // default: maroon
"Tree.textSelectionColor", table.get("textText"), // default: black
"Tree.textNonSelectionColor", table.get("textText"), // default: black
"Tree.backgroundSelectionColor", table.get("text"), // default: white
"Tree.backgroundNonSelectionColor", controlDarker, // default: dark slate blue
"Tree.backgroundNonSelectionColor", controlDarker, // default: dark slate blue
"Tree.openIcon", treeOpenIcon,
"Tree.closedIcon", treeClosedIcon,
"Tree.leafIcon", treeLeafIcon,
"Tree.expandedIcon", treeExpandedIcon,
"Tree.collapsedIcon", treeCollapsedIcon,
"Table.focusCellHighlightBorder", focusCellHighlightBorder,
"Table.scrollPaneBorder", null,
// "Table.background", white, // cell background color
// "Table.focusCellBackground", white,
"ComboBox.control", table.get("control"),
"ComboBox.controlForeground", black,
"ComboBox.renderer", comboBoxRendererActiveValue,
"ComboBox.editor", comboBoxEditorActiveValue,
"ComboBox.background", table.get("window"),
"ComboBox.foreground", black,
"ComboBox.selectedBackground", black,
"ComboBox.selectedForeground", table.get("text"),
"ComboBox.disabledBackground", table.get("control"),
"ComboBox.disabledForeground", table.get("textInactiveText"),
"ComboBox.font", dialogPlain12,
"TextField.caretForeground", black,
"TextField.caretBlinkRate", new Integer(500),
"TextField.inactiveForeground", table.get("textInactiveText"),
"TextField.selectionBackground", table.get("textHighlight"),
"TextField.selectionForeground", table.get("textHighlightText"),
"TextField.background", table.get("window"),
"TextField.foreground", table.get("textText"),
"TextField.font", sansSerifPlain12,
"TextField.border", fieldTextBorder,
"TextField.keyBindings", fieldBindings,
"PasswordField.caretForeground", black,
"PasswordField.caretBlinkRate", new Integer(500),
"PasswordField.inactiveForeground", table.get("textInactiveText"),
"PasswordField.selectionBackground", table.get("textHighlight"),
"PasswordField.selectionForeground", table.get("textHighlightText"),
"PasswordField.background", table.get("window"),
"PasswordField.foreground", table.get("textText"),
"PasswordField.font", monospacedPlain12,
"PasswordField.border", fieldTextBorder,
"PasswordField.keyBindings", fieldBindings,
"TextArea.caretForeground", black,
"TextArea.caretBlinkRate", new Integer(500),
"TextArea.inactiveForeground", table.get("textInactiveText"),
"TextArea.selectionBackground", table.get("textHighlight"),
"TextArea.selectionForeground", table.get("textHighlightText"),
"TextArea.background", table.get("window"),
"TextArea.foreground", table.get("textText"),
"TextArea.font", monospacedPlain12,
"TextArea.border", multilineTextBorder,
"TextArea.keyBindings", multilineBindings,
"TextPane.caretForeground", black,
"TextPane.caretBlinkRate", new Integer(500),
"TextPane.inactiveForeground", table.get("textInactiveText"),
"TextPane.selectionBackground", lightGray,
"TextPane.selectionForeground", table.get("textHighlightText"),
"TextPane.background", white,
"TextPane.foreground", table.get("textText"),
"TextPane.font", serifPlain12,
"TextPane.border", multilineTextBorder,
"TextPane.keyBindings", multilineBindings,
"EditorPane.caretForeground", red,
"EditorPane.caretBlinkRate", new Integer(500),
"EditorPane.inactiveForeground", table.get("textInactiveText"),
"EditorPane.selectionBackground", lightGray,
"EditorPane.selectionForeground", table.get("textHighlightText"),
"EditorPane.background", white,
"EditorPane.foreground", table.get("textText"),
"EditorPane.font", serifPlain12,
"EditorPane.border", multilineTextBorder,
"EditorPane.keyBindings", multilineBindings,
"FileChooser.acceptAllFileFilterText", new String ("*"),
"FileChooser.cancelButtonText", new String("Cancel"),
"FileChooser.saveButtonText", new String("Save"),
"FileChooser.openButtonText", new String("OK"),
"FileChooser.updateButtonText", new String("Update"),
"FileChooser.helpButtonText", new String("Help"),
"FileChooser.cancelButtonToolTipText", new String("Abort file chooser dialog."),
"FileChooser.saveButtonToolTipText", new String("Save selected file."),
"FileChooser.openButtonToolTipText", new String("Open selected file."),
"FileChooser.updateButtonToolTipText", new String("Update directory listing."),
"FileChooser.helpButtonToolTipText", new String("FileChooser help."),
"ToolTip.border", raisedBevelBorder,
"ToolTip.background", table.get("info"),
"ToolTip.foreground", table.get("infoText"),
"OptionPane.errorIcon", LookAndFeel.makeIcon(getClass(),
"icons/Error.gif"),
"OptionPane.informationIcon", LookAndFeel.makeIcon(getClass(),
"icons/Inform.gif"),
"OptionPane.warningIcon", LookAndFeel.makeIcon(getClass(),
"icons/Warn.gif"),
"OptionPane.questionIcon", LookAndFeel.makeIcon(getClass(),
"icons/Question.gif")
};
table.putDefaults(defaults);
}
}